<%@page import="com.ldl.entity.User"%>
<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
   <%
       out.println("session.getId()="+session.getId());
       out.println("cookie:");
       Cookie[] cs = request.getCookies();
       if(cs!=null){
   		  for(Cookie c : cs) {
   			  out.println("\t"+c.getName()+"="+c.getValue());
   		  }
   	   }
       out.println();
       User user = new User();
       user.setUserName("admin");
       session.setAttribute("user", user);
       
   %>
   
   <a href="session-2.jsp">session-2.jsp</a>
	<a href="<%=response.encodeURL("session-2.jsp")%>"><%=response.encodeURL("session-2.jsp")%></a>
</body>
</html>